<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ include file="../../includes/common.jsp" %>


 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta name="META_MAIN_MENU_ID" content="ADMIN_ARTICLES" />
        <title>文章信息编辑</title>
        <meta name="search" content="price" />
        <meta name="author" content="chunhai.chen(15317227@qq.com)" />
        <c:if test="${not empty article}">
            <c:choose>
                <c:when test="${article.status == 'ONLINE'}">
                    <c:set var="adminlink1" value="<A href='/admin/article/unpublish.htm?uid=${article.uid }'>下架</A>&nbsp;" />
                </c:when>
                <c:otherwise>
                    <c:set var="adminlink1" value="<A href='/admin/article/publish.htm?uid=${article.uid }'>上架</A>&nbsp;" />
                </c:otherwise>
            </c:choose>
			<c:set var="adminlink2" value="<A href='/article/${article.uid }.htm'>查看</A>&nbsp;" />
			<c:set var="adminlink3" value="<A href='/admin/article/delete.htm?uid=${article.uid }'>删除</A>&nbsp;" />
			<c:set var="adminlink4" value="<A href='/person/requestdownload/article.htm?uid=${article.uid }'>转载</A>&nbsp;" />
            <meta name="adminLinks" content="【${article.name }：${adminlink1 }-${adminlink2 }-${adminlink3 }-${adminlink4 } 】" />
        </c:if>
        <c:if test="${not empty currentCategory && not empty primaryCategoryTrail}">
            <c:set var="pguid" value="${currentCategory.uid}"></c:set>
            <c:set var="trailLinks" value="">
            </c:set>
            <c:forEach items="${primaryCategoryTrail}" var="v" varStatus="vst">
            	<c:set var="class" value=""/>
            	<c:if test="${v.uid == currentCategory.uid}"><c:set var="class" value="current"/></c:if>			
                <c:set var="tmp" value="<span class='sep'>› </span><a class='${class}' href='/admin/article/list.htm?guid=${v.uid}'>${v.name}</a>"/>
                <c:set var="trailLinks" value="${trailLinks}${tmp}">
                </c:set>
            </c:forEach>
            <meta name="trailLinks" content="${trailLinks}" />
        </c:if>
		<c:set var="requester" value="<%=request.getServerName()+ (request.getServerPort()==80 ? "" : ":"+request.getServerPort())%>"/>
    </head>
    <body>
        <div style="padding:20px;">
        	
            <c:if test="${not empty article}">
            <form:form action="/admin/article/edit.htm"  commandName="article" method="put" enctype="multipart/form-data">
			<%--Any fields they're not filling in have to be carried over in hidden fields because of request scoping --%>
			<form:hidden path="uid" />
			<font color="red"><form:errors path="*" /> </font>
			<table width='100%' id="customerTable" class="yui-grid">
				<thead>
					<tr>
						<th colspan="2" align='left' nowrap> <p style='font-size: 20px;margin:0'>修改[<A href='/article/${article.uid }.htm' target="_blank">${article.name}</A>]文章</p> </th>
					</tr>
				</thead>
			

        

            	<tr><td nowrap>名称</td><td><form:input path="name"  size='60'/> <font color="red"><form:errors path="name" /> </font></td></tr>

            	<tr><td nowrap>标签</td><td><form:input path="tags"  size='60'/> <font color="red"><form:errors path="tags" /> </font>以<font color="red"> , 或   ; 或  空格</font> 分割标签</td></tr>
            	<tr><td nowrap>分组标签</td><td><form:input path="groupTag"  size='60'/> <font color="red"><form:errors path="tags" /> </font></td></tr>

            	<tr><td nowrap>详细</td>
            		<td><form:textarea path="longDesc" rows="6" cols="80" />
						<script type="text/javascript">CKEDITOR.replace( 'longDesc', { customConfig : '/js/ckeditor/config_basic.js' } );</script>
            		</td> 
            	</tr>
            	
            	<tr><td nowrap>作者</td><td>
					<c:if test="${not empty article.author }">
					<span class="author"><a title="由 ${article.author.name } 发表" href="http://${article.author.blogUrl }">${article.author.name }</a></span>
					</c:if>
            	</td> </tr>
            	
            	<tr><td nowrap>是否公告</td><td>
                     	是<form:radiobutton path="pubadv" value="true"/> <font color="red"><form:errors path="pubadv" /> </font>
                     	否<form:radiobutton path="pubadv" value="false"/> <font color="red"><form:errors path="pubadv" /> </font>
            	</td> </tr>
            	
            	<tr><td nowrap>是否置顶</td><td>
                     	是<form:radiobutton path="topped" value="true"/> <font color="red"><form:errors path="topped" /> </font>
                     	否<form:radiobutton path="topped" value="false"/> <font color="red"><form:errors path="topped" /> </font>
            	</td> </tr>
            	
            	<tr><td nowrap>状态</td><td>
                     <c:choose>
                         <c:when test="${article.status == 'ONLINE'}"> 已公开</c:when>
                         <c:otherwise> 未公开 </c:otherwise>
                     </c:choose>
            	</td> </tr>
            	<tr><td width=1 nowrap>分类</td>
            		<td>
            			<c:choose>
	            			<c:when test="${not empty trailLinks}">${trailLinks}</c:when>
	            			<c:otherwise><font color="red">请设置文章所属分类，否则站内分类浏览找不到本文章</font></c:otherwise>
            			</c:choose>            		
            		</td>
            	</tr>

				<tr>
					<td></td>
					<td><p class="submit"><input type="submit" value="修改文章" /></p></td>
				</tr>
						
			</table>
			</form:form>
            </c:if>
        </div>
    </body>
</html>



